package com.example.xunua_zhinengjiaotong;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;

import java.util.Timer;
import java.util.TimerTask;

public class WelcomeActivity extends AppCompatActivity {
    static WelcomeActivity welcomeActivity;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        welcomeActivity=this;
        final LinearLayout line=findViewById(R.id.welcome_line);
//        添加动画 AnimationUtils拿到动画对象
        Animation animation = AnimationUtils.loadAnimation(WelcomeActivity.this, R.anim.login);
        animation.setFillAfter(true);
        line.startAnimation(animation);

//        延时弹出登录窗口
        Timer timer=new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                startActivity(new Intent(WelcomeActivity.this,IpLoginActivity.class));
            }
        },3000);
    }
    @Override
    public void onBackPressed() {
        // super.onBackPressed();
    }
}
